<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The DateTimeInterface interface</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="datetimeimmutable.sub.html">DateTimeImmutable::sub</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="datetime.diff.html">DateTime::diff</a></div>
 <div class="up"><a href="book.datetime.html">Date/Time</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="class.datetimeinterface" class="reference">

 <h1 class="title">The DateTimeInterface interface</h1>
 

 <div class="partintro"><p class="verinfo">(PHP 5 &gt;= 5.5.0)</p>


  <div class="section" id="datetimeinterface.intro">
   <h2 class="title">简介</h2>
   <p class="para">

   </p>
  </div>


  <div class="section" id="datetimeinterface.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass"></div>


    <div class="classsynopsisinfo">
     <span class="ooclass">
      <strong class="classname">DateTimeInterface</strong>
     </span>
     {</div>

    
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">DateInterval</span><span class="methodname"><a href="datetime.diff.html" class="methodname">diff</a></span>
    ( <span class="methodparam"><span class="type"><a href="class.datetimeinterface.html" class="type DateTimeInterface">DateTimeInterface</a></span> <code class="parameter">$datetime2</code></span>
   [, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$absolute</code><span class="initializer"> = false</span></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="datetime.format.html" class="methodname">format</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$format</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">int</span><span class="methodname"><a href="datetime.getoffset.html" class="methodname">getOffset</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">int</span><span class="methodname"><a href="datetime.gettimestamp.html" class="methodname">getTimestamp</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">DateTimeZone</span><span class="methodname"><a href="datetime.gettimezone.html" class="methodname">getTimezone</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><a href="datetime.wakeup.html" class="methodname">__wakeup</a></span>
    ( <span class="methodparam">void</span>
   )</div>

   }</div>


  </div>

 </div>

 











































<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="datetime.diff.html">DateTime::diff</a> — Returns the difference between two DateTime objects</li><li><a href="datetime.format.html">DateTime::format</a> — Returns date formatted according to given format</li><li><a href="datetime.getoffset.html">DateTime::getOffset</a> — Returns the timezone offset</li><li><a href="datetime.gettimestamp.html">DateTime::getTimestamp</a> — Gets the Unix timestamp</li><li><a href="datetime.gettimezone.html">DateTime::getTimezone</a> — Return time zone relative to given DateTime</li><li><a href="datetime.wakeup.html">DateTime::__wakeup</a> — The __wakeup handler</li></ul>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="datetimeimmutable.sub.html">DateTimeImmutable::sub</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="datetime.diff.html">DateTime::diff</a></div>
 <div class="up"><a href="book.datetime.html">Date/Time</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
